package cn.com.cetccst.datacenter.policy.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Query;

import java.util.List;

import cn.com.cetccst.datacenter.collection.dao.BaseDao;
import cn.com.cetccst.datacenter.policy.entity.PolicyEntity;

@Dao
public interface PolicyDao extends BaseDao<PolicyEntity> {

    @Query("select * from " + PolicyEntity.TABLE_NAME + " where policy_name = :policyName LIMIT 1")
    LiveData<PolicyEntity> query(String policyName);

    @Query("select * from " + PolicyEntity.TABLE_NAME )
    LiveData<List<PolicyEntity>> queryAll();
}
